package cn.lili.modules.promotion.entity.dos;

import cn.lili.common.utils.StringUtils;
import cn.lili.mybatis.model.BaseStandardEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author xiangqian
 * @version 1.0
 * @data 2023/12/20 13:43
 */
@Data
@TableName("li_green_unit_price")
@ApiModel(value = "绿色积分池-当前单价")
public class GreenUnitPrice extends BaseStandardEntity {

    @ApiModelProperty(value = "当前单价")
    private BigDecimal unitPrice;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "单价时间", hidden = true)
    private Date unitTime;

    public LambdaQueryWrapper<GreenUnitPrice> queryWrapperPage() {
        LambdaQueryWrapper<GreenUnitPrice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(GreenUnitPrice::getDeleteFlag,false);
        lambdaQueryWrapper.orderByDesc(GreenUnitPrice::getCreateTime);
        return lambdaQueryWrapper;
    }
}
